package com.xliang.spider.util;

import org.jsoup.Connection;
import org.jsoup.Jsoup;

/**
 * ${DESCRIPTION}
 *
 * @author xiongl
 * @create 2016-06-14 10:08
 */
public class ConnectionUtil
{
    public static Connection getConnection(String url)
    {
        org.jsoup.Connection con = Jsoup.connect(url);
        con.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
        con.header("Accept-Encoding", "gzip, deflate");
        con.header("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
        con.header("Connection", "keep-alive");
        con.header("Host", "www.jikexueyuan.com");
        con.header("Referer", url);
        con.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0");
        con.timeout(60000);
        return con;
    }
}
